<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.prime.com.tr/ui"
	template="/WEB-INF/jsf/template.xhtml">

	<ui:define name="head">
	</ui:define>

	<ui:define name="content">
		<h1>Manage #{patientmsgs['patient.title']}s</h1>
		
		<h:form>	
			<p:commandButton image="new" ajax="false" style="margin-right:20px;" value="#{patientmsgs['navigation.new']}" action="#{PatientComponent.newPatient()}"/>
			<p:dataTable id="dta" value="#{PatientComponent.listPatients()}"  var="current" rows="15" paginator="true" paginatorPosition="bottom">
				<p:column>
					<h:commandLink includeViewParams="true" action="#{PatientComponent.selectPatient(current.patPatient)}" >
						<h:graphicImage value="/images/icons/view.gif" style="border:0;"/>
					</h:commandLink>
					<h:commandLink includeViewParams="true" action="#{PatientComponent.editPatient(current.patPatient)}" >
						<h:graphicImage value="/images/icons/edit.gif" style="border:0;"/>
					</h:commandLink>
					<h:commandLink includeViewParams="true" action="#{PatientComponent.confirmDeletePatient(current.patPatient)}" >
						<h:graphicImage value="/images/icons/delete.gif" style="border:0;"/>
					</h:commandLink>
				</p:column>
				<p:column> 
					<f:facet name="header">
						<h:outputText value="#{patientmsgs['patient.patpatient.title']}" />
					</f:facet>
							<h:outputText value="#{current.patPatient}"/>
				</p:column>
				<p:column> 
					<f:facet name="header">
						<h:outputText value="#{patientmsgs['patient.patdateentree.title']}" />
					</f:facet>
							<h:outputText value="#{current.patDateEntree}"  converter="dateConverterForCalendar" />
				</p:column>
				<p:column> 
					<f:facet name="header">
						<h:outputText value="#{patientmsgs['patient.pattelcontact.title']}" />
					</f:facet>
							<h:outputText value="#{current.patTelContact}"/>
				</p:column>
				<p:column> 
					<f:facet name="header">
						<h:outputText value="#{patientmsgs['patient.patdivers.title']}" />
					</f:facet>
							<h:outputText value="#{current.patDivers}"/>
				</p:column>
				<p:column> 
					<f:facet name="header">
						<h:outputText value="#{patientmsgs['patient.patdatesortie.title']}" />
					</f:facet>
							<h:outputText value="#{current.patDateSortie}"  converter="dateConverterForCalendar" />
				</p:column>
				<p:column> 
					<f:facet name="header">
						<h:outputText value="#{patientmsgs['patient.pataxemedical.title']}" />
					</f:facet>
							<h:outputText value="#{current.patAxeMedical}"/>
				</p:column>
				<p:column> 
					<f:facet name="header">
						<h:outputText value="#{patientmsgs['patient.patsousaxemedical.title']}" />
					</f:facet>
							<h:outputText value="#{current.patSousAxeMedical}"/>
				</p:column>
				<p:column> 
					<f:facet name="header">
						<h:outputText value="#{patientmsgs['patient.patmotifsortie.title']}" />
					</f:facet>
							<h:outputText value="#{current.patMotifSortie}"/>
				</p:column>
				<p:column> 
					<f:facet name="header">
						<h:outputText value="#{patientmsgs['patient.patdiagnostic.title']}" />
					</f:facet>
							<h:outputText value="#{current.patDiagnostic}"/>
				</p:column>
				<p:column> 
					<f:facet name="header">
						<h:outputText value="#{patientmsgs['patient.patdatedernierevisite.title']}" />
					</f:facet>
							<h:outputText value="#{current.patDateDerniereVisite}"  converter="dateConverterForCalendar" />
				</p:column>
			</p:dataTable>
		</h:form>
	</ui:define>
</ui:composition>
